/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ro.unibuc.nautilus.dao;

import java.io.Serializable;
import java.util.List;

/**
 * @author Root
 */
public interface GenericDAO<T, PK extends Serializable> {

	/** 
	 * Persist the newInstance object into database 
	 */
	PK create(T newInstance);

	/**
	 * Retrieve an object that was previously persisted to the database using
	 * the indicated id as primary key.
	 */
	T find(PK id);

	/** 
	 * Save changes made to a persistent object. 
	 */
	void update(T transientObject);

	/** 
	 * Remove an object from persistent storage in the database.
	 */
	void delete(T persistentObject);

	/** 
	 * Return list of objects.
	 */
	public List<T> findAll();
}
